package o;

import android.content.res.AssetManager;
import android.util.Log;
import androidx.annotation.NonNull;
import java.io.IOException;
import o.sg.d;

public abstract class sk<T> implements sg<T> {
    private final AssetManager ˊ;
    private T ˋ;
    private final String ॱ;

    protected abstract void ˊ(T t) throws IOException;

    protected abstract T ˎ(AssetManager assetManager, String str) throws IOException;

    public sk(AssetManager assetManager, String str) {
        this.ˊ = assetManager;
        this.ॱ = str;
    }

    public void ˏ(@NonNull rl rlVar, @NonNull d<? super T> dVar) {
        try {
            this.ˋ = ˎ(this.ˊ, this.ॱ);
            dVar.ॱ(this.ˋ);
        } catch (Throwable e) {
            if (Log.isLoggable("AssetPathFetcher", 3)) {
                Log.d("AssetPathFetcher", "Failed to load data from asset manager", e);
            }
            dVar.ˏ(e);
        }
    }

    public void ˏ() {
        if (this.ˋ != null) {
            try {
                ˊ(this.ˋ);
            } catch (IOException e) {
            }
        }
    }

    public void ॱ() {
    }

    @NonNull
    public rz ˎ() {
        return rz.LOCAL;
    }
}
